// pages/mange/album/create.js
const request=require("../../../wechat-lib/request")
const login=require('../../../wechat-lib/login');
const common=require('../../../wechat-lib/common');
Page({
  mixins: [require('../../../wechat-lib/themeChanged'),require('../../../wechat-lib/validForm')],
  /**
   * 页面的初始数据
   */
  data: {

  },
  submit:async function() {
    if(await this.validForm('#form')){
      login.getJwtPayload().then(success=>{
        console.log(success)
        request.post("album","editAlbum",this.data.formData).then(
          success=>{
            this.setData({
              [`formData._id`]:success._id
            })
          },
          err=>{
            common.showErrorMsg(err)
            // console.log(err)
          }
        )
      },err=>{
        common.showErrorMsg(err)
      })
    }
  }
})